//
// CPSRibbonBase.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.IStream;

public class CPSRibbonBase extends CPSParticle {
  private long swigCPtr;

  public CPSRibbonBase(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CPSRibbonBase_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CPSRibbonBase obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CPSRibbonBase(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public void serial(IStream f) {
    nel3dJNI.CPSRibbonBase_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public void setRibbonMode(CPSRibbonBase.TRibbonMode mode) {
    nel3dJNI.CPSRibbonBase_setRibbonMode(swigCPtr, this, mode.swigValue());
  }

  public CPSRibbonBase.TRibbonMode getRibbonMode() {
    return CPSRibbonBase.TRibbonMode.swigToEnum(nel3dJNI.CPSRibbonBase_getRibbonMode(swigCPtr, this));
  }

  public void setInterpolationMode(CPSRibbonBase.TInterpolationMode mode) {
    nel3dJNI.CPSRibbonBase_setInterpolationMode(swigCPtr, this, mode.swigValue());
  }

  public CPSRibbonBase.TInterpolationMode getInterpolationMode() {
    return CPSRibbonBase.TInterpolationMode.swigToEnum(nel3dJNI.CPSRibbonBase_getInterpolationMode(swigCPtr, this));
  }

  public void setMatrixMode(CPSRibbonBase.TMatrixMode matrixMode) {
    nel3dJNI.CPSRibbonBase_setMatrixMode(swigCPtr, this, matrixMode.swigValue());
  }

  public CPSRibbonBase.TMatrixMode getMatrixMode() {
    return CPSRibbonBase.TMatrixMode.swigToEnum(nel3dJNI.CPSRibbonBase_getMatrixMode(swigCPtr, this));
  }

  public void setTailNbSeg(long nbSegs) {
    nel3dJNI.CPSRibbonBase_setTailNbSeg(swigCPtr, this, nbSegs);
  }

  public long getTailNbSeg() {
    return nel3dJNI.CPSRibbonBase_getTailNbSeg(swigCPtr, this);
  }

  public void setSegDuration(float ellapsedTime) {
    nel3dJNI.CPSRibbonBase_setSegDuration(swigCPtr, this, ellapsedTime);
  }

  public float getSegDuration() {
    return nel3dJNI.CPSRibbonBase_getSegDuration(swigCPtr, this);
  }

  public void setRibbonLength(float length) {
    nel3dJNI.CPSRibbonBase_setRibbonLength(swigCPtr, this, length);
  }

  public float getRibbonLength() {
    return nel3dJNI.CPSRibbonBase_getRibbonLength(swigCPtr, this);
  }

  public void setLODDegradation(float percent) {
    nel3dJNI.CPSRibbonBase_setLODDegradation(swigCPtr, this, percent);
  }

  public float getLODDegradation() {
    return nel3dJNI.CPSRibbonBase_getLODDegradation(swigCPtr, this);
  }

  public final static class TMatrixMode {
    public final static TMatrixMode FXWorldMatrix = new TMatrixMode("FXWorldMatrix", nel3dJNI.CPSRibbonBase_FXWorldMatrix_get());
    public final static TMatrixMode IdentityMatrix = new TMatrixMode("IdentityMatrix");
    public final static TMatrixMode UserMatrix = new TMatrixMode("UserMatrix");
    public final static TMatrixMode FatherMatrix = new TMatrixMode("FatherMatrix");
    public final static TMatrixMode MatrixModeCount = new TMatrixMode("MatrixModeCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TMatrixMode swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TMatrixMode.class + " with value " + swigValue);
    }

    private TMatrixMode(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TMatrixMode(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TMatrixMode(String swigName, TMatrixMode swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TMatrixMode[] swigValues = { FXWorldMatrix, IdentityMatrix, UserMatrix, FatherMatrix, MatrixModeCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TRibbonMode {
    public final static TRibbonMode VariableSize = new TRibbonMode("VariableSize", nel3dJNI.CPSRibbonBase_VariableSize_get());
    public final static TRibbonMode FixedSize = new TRibbonMode("FixedSize");
    public final static TRibbonMode RibbonModeLast = new TRibbonMode("RibbonModeLast");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TRibbonMode swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TRibbonMode.class + " with value " + swigValue);
    }

    private TRibbonMode(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TRibbonMode(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TRibbonMode(String swigName, TRibbonMode swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TRibbonMode[] swigValues = { VariableSize, FixedSize, RibbonModeLast };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TInterpolationMode {
    public final static TInterpolationMode Linear = new TInterpolationMode("Linear", nel3dJNI.CPSRibbonBase_Linear_get());
    public final static TInterpolationMode Hermitte = new TInterpolationMode("Hermitte");
    public final static TInterpolationMode InterpModeLast = new TInterpolationMode("InterpModeLast");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TInterpolationMode swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TInterpolationMode.class + " with value " + swigValue);
    }

    private TInterpolationMode(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TInterpolationMode(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TInterpolationMode(String swigName, TInterpolationMode swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TInterpolationMode[] swigValues = { Linear, Hermitte, InterpModeLast };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
